<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./lib/layui-v2.3.0/css/layui.css" media="all">

</head>

<body>
  <div class="layui-carousel" id="test1">
    <div carousel-item>
      <div>条目1</div>
      <div>条目2</div>
      <div>条目3</div>
      <div>条目4</div>
      <div>条目5</div>
    </div>
  </div>
  <script src="./lib/layui-v2.3.0/layui.js" charset="utf-8"></script>
  <script>
    layui.use('carousel', function () {
      var carousel = layui.carousel;
      //建造实例
      carousel.render({
        elem: '#test1',
        width: '500px' //设置容器宽度
          ,
        arrow: 'always' //始终显示箭头
        //,anim: 'updown' //切换动画方式
      });
    });
  </script>
</body>

</html>